home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_gnats.idb / usr / freeware / lib / gnats / mkcat.z / mkcat
Encoding:
Text File  |  1999-04-16  |  1.7 KB  |  60 lines

  1. #!/bin/sh
  2. # Create directories for each category in a GNATS categories file. 
  3. # Copyright (C) 1993 Free Software Foundation, Inc.
  4. # Contributed by Brendan Kehoe (brendan@cygnus.com) and
  5. # Tim Wicinski (wicinski@barn.com).
  6. #
  7. # This file is part of GNU GNATS.
  8. #
  9. # GNU GNATS is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2, or (at your option)
  12. # any later version.
  13. #
  14. # GNU GNATS is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with GNU GNATS; see the file COPYING.  If not, write to
  21. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  
  23. GNATS_ROOT=/usr/freeware/lib/gnats/gnats-db
  24. GNATS_SITE=humu
  25. DATADIR=/usr/freeware/lib
  26.  
  27. CATEGORIES=`grep -v '^#' $GNATS_ROOT/gnats-adm/categories | sed -e 's/:.*//g'`
  28.  
  29. # Newer config information?
  30. [ -f ${GNATS_ROOT}/gnats-adm/config ] && . ${GNATS_ROOT}/gnats-adm/config
  31.  
  32. if [ ! -d $DATADIR/gnats ]; then
  33.   echo "$0: No directory $DATADIR/gnats!"
  34.   exit 1
  35. fi
  36.  
  37. if [ ! -d $DATADIR/gnats/dist ]; then
  38.   echo "$0: No directory $DATADIR/gnats/dist!"
  39.   exit 1
  40. fi
  41.  
  42. rm -f $DATADIR/gnats/dist/categories $DATADIR/gnats/$GNATS_SITE
  43. touch $DATADIR/gnats/dist/categories $DATADIR/gnats/$GNATS_SITE
  44.  
  45. for i in $CATEGORIES; do
  46.     
  47.     if test -d $GNATS_ROOT/$i; then
  48.     true
  49.     else
  50.     mkdir $GNATS_ROOT/$i
  51.         echo creating category $GNATS_ROOT/$i
  52.     fi
  53.  
  54.     echo $i >> $DATADIR/gnats/dist/categories
  55.     echo $i >> $DATADIR/gnats/$GNATS_SITE
  56.  
  57. done
  58.  
  59. exit 0
  60.